module immd_ext_0(out, in, s_z);
input[4:0] in;
input s_z;

output[15:0] out;

assign out = (s_z)? {12{in[4], in[3:0]}} : {11{1'b0}, in};
// 1 for sign ext, 0 for zero ext

endmodule
